package com.xuyiwei.mayi.service;

import com.xuyiwei.mayi.base.ResponseBase;
import com.xuyiwei.mayi.entity.UserEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * Created by xuyiwei on 2019/4/26.
 */
@RequestMapping("/member")
public interface MemberService {
//    @RequestMapping("/testRest")
//    Map<String, Object> testRest();

    // 使用userId查找用户信息
    @RequestMapping("/findUserById")
    ResponseBase findUserById(Long userId);

    // 注册用户
    @RequestMapping("/register")
    ResponseBase register(@RequestBody UserEntity userEntity);

    // 登录用户
    @RequestMapping("/login")
    ResponseBase login(@RequestBody UserEntity userEntity);

    // 登录用户 如果是post请求记得加param参数
    @RequestMapping("/findUserByToken")
    ResponseBase findUserByToken(@RequestParam("token") String token);

}

